package it.unical.canonaco.rende.igpe.game.cbv.datastructure;

/**This is class is a support for programmer. This class allows the reference passage of boolean.
 * In particular this class wraps a single and simple boolean attribute. */
public class UtilityBoolean {

/**It's the boolean value of this class. */
private boolean boolean_value;

/**This constructor creates and new UtilityBoolean, it sets the starting value of the boolean attribute to false. */
public UtilityBoolean(){
	boolean_value = false;
}

/**This constructor creates and new UtilityBoolean, it sets the boolean value equals to the passed boolean attribute.
 * @param starting_value is the boolean value that will be set. */
public UtilityBoolean(final boolean starting_value){
	boolean_value = starting_value;
}

/**This method changes the actual boolean value to the new one.
 * @param new_value is the new boolean value that will be set. */
public void changeValue(final boolean new_value){
	boolean_value = new_value;
}

/**This method return the boolean value.
 * @return True, if the boolean value is true; false otherwise.*/
public boolean getBooleanValue(){
	return boolean_value;
}

	/**This method converts the boolean value to a string.
	 * @return The string equals to the boolean value. */
	@Override
	public String toString() {
		if(boolean_value)
				return new String("true");
	
		return new String("false");
	}
}
